//
//  RequestHelper.h
//  MCF2
//
//  Created by QianDeng on 15/6/9.
//  Copyright (c) 2015年 ac. All rights reserved.
//

#import <Foundation/Foundation.h>

#define  ProtSuc     0     //成功
#define  ProtErr     -1    //失败

#define ClientSecret   @"tKolfuUi6d4W6sOTTx4VBs05cF6h9nHY"
#define IOSAppId       @"10010"

@interface RequestHelper : NSObject

//生成HTTP请求的header参数
+ (NSMutableDictionary *)createRequestHeaderParams;

/**创建page属性参数
 *@param  index   页码
 *@param  size    个数
 *@param  direction
 */
+ (NSMutableDictionary *)createPagingSettingWithPageIndex:(NSInteger)index size:(NSInteger)size direction:(NSInteger)direction orderBy:(NSInteger)orderBy;


+ (NSMutableDictionary *)resovleRequestCallBack:(NSDictionary *)dict;

+ (NSString *)createSiginCode:(NSString *)methodName withParams:(NSDictionary *)params withTimeStamp:(NSNumber *)stamp;

//签名
+ (NSString *)createMD5SiginCode:(NSString *)methodName withParams:(NSDictionary *)params;

//URL添加cookie
+ (void)addCookieWithUrl:(NSString *)url;

//获取网络请求错误信息
+ (NSString *)getRequestErrorInfo:(NSDictionary *)retDict;

//提示网络错误，请稍后再试
+ (void)showRequestNetWorkError;

//提示错误信息
+ (void)showRequestErrorInfo:(NSString *)errorMsg;

//生成请求参数
+ (NSMutableDictionary *)createRequestParamsWithBodyParams:(NSDictionary *)bodyParams;

@end
